<!--
Admin Individual Course
There will be many Admin Individual Course pages. Each will contain tools to help administer an individual course in the database. Contains:

Course vital information (editable except for course code)
section code textbox + [add section]
section listing
	list of <Admin Individual Section> + [remove section]
-->

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html:html>
<head>
<title><bean:message key="adminindividualcourses.heading"/></title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/default.css" type="text/css">
</head>
<body>

<div id="header">
	<div id="logo">
		<h1>
			<html:img width="40" src="../images/EMPTY.GIF"/>
			<html:link page="/pages/home.jsp">Textbook Crossroads</html:link>
		</h1>
		<h2>Team 14 - LoneTree</h2>
	</div>
	<div id="menu">
		<ul>
			<li class="active"><html:link page="/pages/admindashboard.jsp">Dashboard</html:link></li>
			<li><html:link page="/pages/books.jsp">Books</html:link></li>
			<li><html:link page="/pages/courses.jsp">Courses</html:link></li>
			<li><html:link page="/pages/about.jsp">About</html:link></li>
			<li class="logon"><html:link action="/logout">LogOut</html:link></li> 
		</ul>
	</div>
</div>

<logic:notPresent name="org.apache.struts.action.MESSAGE" scope="application">
  <font color="red">
    ERROR:  Application resources not loaded -- check servlet container
    logs for error messages.
  </font>
</logic:notPresent>

<% String add_msg = (String)request.getAttribute("section.add.message");
if(add_msg == null)
	add_msg = "";

String rem_msg = (String)request.getAttribute("section.remove.message");
if(rem_msg == null)
	rem_msg = ""; %>

<%=add_msg %><%=rem_msg %>

<div id="content">
	<div id="sidebar">
			<div id="categories">
			<div id="archives" class="boxed">
				<h2><html:link href="admindashboard.jsp">Admin Actions</html:link></h2>
				<div class="content">
					<ul>
			    		<li><html:link href="bookadmin.jsp"><bean:message
			            key="adminbook.link"/></html:link></li>
			            
			            <li><html:link action="/AdminCourses"><bean:message
			            key="admincourses.link"/></html:link></li>
			            
			            <li><html:link action="/AdminAccounts"><bean:message
			            key="adminaccounts.link"/></html:link></li>
			            
			            <li><html:link action="/AdminComments"><bean:message
			            key="admincomments.link"/></html:link></li>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<div id="posts">
		<div class="post">
			<h2 class="title"><bean:message key="adminindividualcourses.title"/></h2>
			<div class="meta">
				<p class="date">Details:</p>
			</div>
			<div class="story">
				<ul>
					<li>
					<h3><bean:message key="adminindividualcourses.add"/></h3>
					<table border="0">
						<html:form action="AddSection" method="post">
							<tr>
								<td><bean:message key="addsection.code"/></td>
								<td><html:text property="section_code" size="4" maxlength="4" /></td>
							</tr>
							<tr>
								<td><bean:message key="addsection.number"/></td> 
								<td><html:text property="course_number" size="3" maxlength="3" /></td>
							</tr>
							<tr>
								<td><bean:message key="addsection.ctitle"/> </td>
								<td><html:text property="course_title" size="50" maxlength="50" /></td>
							</tr>
							<tr>
								<td><html:submit value="Add Section" /></td>
							</tr>
						</html:form>
					</table>
					</li><br>
					
					<li>
					<h3> <bean:message key="adminindividualcourses.remove"/> </h3>
					<form action="../RemoveCourse.do">
					<bean:message key="removesection.txtbox"/><br>
					<input type="text" name="cidstring" size="8" maxlength="8">
					<input type="submit" value="Remove">
					</form>
					</li>
					         
					<li>
					<h3> <bean:message key="adminindividualcourses.modify"/> </h3>
					<%--        pass the value in the txtbox to the next page 			--%>
					<form action="../SearchCourse.do"> 
					<bean:message key="modifysection.txtbox"/><br>
					<input type="text" name="cidstring" size="8" maxlength="8">
					<input type="submit" value="Modify">
					</form>
					
					</li>
				</ul>
				
				<%--
				  <logic:present name="updated">
				  The course has been updated.<br><br>
				  <bean:write name="updated" property="course_code"/><br>
				  <bean:write name="updated" property="course_number"/><br>
				  <bean:write name="updated" property="course_title"/><br>
				  </logic:present>
				  
				  <logic:present name="prefilled">
				    <html:form action="UpdateCourse_after" method="post" >
				      <table border="0">        
				        <tr>
				          <td>Course Code:</td>
				          <td><html:text property="course_code" /></td>
				        </tr>
				        
				        <tr>
				          <td>Course Number:</td>
				          <td><html:text property="course_number" /></td>
				        </tr>
				
				        <tr>
				          <td>Course Title:</td>
				          <td><html:text property="course_title" /></td>
				        </tr>
				        <tr>
				          <td colspan="2" align="center"><html:submit /></td>
				        </tr>
				      </table>
				    </html:form>
				    </logic:present>
				--%>
			</div>
		</div>
	</div>
</div>

<div id="footer">
	<p id="copy">&copy;2007 LoneTree.</p>
	<p> (Andrew Lee | Bojan Martin | Dimeji Omikunle | Minghui Yu)</p>
</div>
</body>
</html:html>